<!DOCTYPE html>
<html lang="en">
<style>
    img {
        width: 1000px;
        height: 500px;
    }
</style>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button id="img1">图片1</button>
    <button id="img2">图片2</button> <br>
    <img src="img/200H3121005-4.jpg" alt="" title="图片1">
    <script>
        //1.获取元素
        var img1 = document.getElementById('img1')
        var img2 = document.getElementById('img2')
        var img = document.querySelector('img')
        //2.处理程序
        img1.onclick = function () {
            img.src = 'img/200H3121005-4.jpg'
            img.title = '图片1'
        }
        img2.onclick = function () {
            img.src = 'img/常见的鼠标事件.png'
            img.title = '图片2'
        }

    </script>
</body>

</html>